import {doGet} from "@/net/axios-request.ts";
import type {PagedData} from "@/net/Result.ts";

export interface Comment {
    commentId: number,
    userId: number,
    postId: number,
    parentId: number,
    content: string,
    createdAt: string
}

export async function getComments(postId: number, page: number) {
    return (await doGet<PagedData<Comment>>("/api/comment/post", {}, { postId: postId, page: page })).data
}